<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>

</head>

<body>
    <a name="list">The list</a>
    <ul>
        <li><a href="http://google.com">http://google.com</a></li>
        <li><a href="/tutorial">/tutorial.html</a></li>
        <li><a href="local/path">local/path</a></li>
        <li><a href="ftp://ftp.com/my.zip">ftp://ftp.com/my.zip</a></li>
        <li><a href="http://nodejs.org">http://nodejs.org</a></li>
        <li><a href="http://internal.com/test">http://internal.com/test</a></li>
    </ul>

    <script>
        // // 为单个链接设置样式
        // let link = document.querySelector('a');
        // link.style.color = 'orange';

        // 多个：
        let links = document.querySelectorAll('a');
        console.log(links);
        for (let link of links) {
            let href = link.getAttribute('href');
            if (!href) continue;
            if (!href.includes('://')) continue;
            if (href.startsWith('http://internal.com')) continue;
            link.style.color = 'orange';
        }
    </script>
    <script>

    </script>
</body>

</html>